package com.example.netty.listener;

import com.example.netty.protocol.SampleLongConnectNettyServerWrap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * Created by l.wang on 2018/3/28.
 */
@Component
public class ContextStartedEventListener implements ApplicationListener<ContextRefreshedEvent> {
    @Autowired
    private SampleLongConnectNettyServerWrap sampleLongConnectNettyServerWrap;

    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        sampleLongConnectNettyServerWrap.start();
    }
}
